<!--
/**
 * Copyright © 2013-2017 Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<div class="payment-method" data-bind="css: {'_active': (getCode() == isChecked())}">
    <div class="payment-method-title field choice">
        <input type="radio"
               name="payment[method]"
               class="radio"
               data-bind="attr: {'id': getCode()}, value: getCode(), checked: isChecked, click: selectPaymentMethod, visible: isRadioButtonVisible()"/>
        <label class="label" data-bind="attr: {'for': getCode()}">
            <span data-bind="text: getTitle()"></span>
        </label>
    </div>

    <div class="payment-method-content">
        <!-- ko foreach: getRegion('messages') -->
        <!-- ko template: getTemplate() --><!-- /ko -->
        <!--/ko-->
        <div class="payment-method-billing-address">
            <!-- ko foreach: $parent.getRegion(getBillingAddressFormName()) -->
            <!-- ko template: getTemplate() --><!-- /ko -->
            <!--/ko-->
        </div>
        <iframe width="0"
                height="0"
                data-bind="src: getSource(), attr: {id: getCode() + '-transparent-iframe', 'data-container': getCode() + '-transparent-iframe'}"
                allowtransparency="true"
                frameborder="0"
                name="iframeTransparent"
                class="payment-method-iframe">
        </iframe>
        <form class="form" id="co-transparent-form" action="#" method="post" data-bind="mageInit: {
            'transparent':{
                'context': context(),
                'controller': getControllerName(),
                'gateway': getCode(),
                'orderSaveUrl':getPlaceOrderUrl(),
                'cgiUrl': getCgiUrl(),
                'dateDelim': getDateDelim(),
                'cardFieldsMap': getCardFieldsMap(),
                'nativeAction': getSaveOrderUrl()
            }, 'validation':[]}">

            <!-- ko template: 'Magento_Payment/payment/cc-form' --><!-- /ko -->
        </form>
        <div class="checkout-agreements-block">
            <!-- ko foreach: $parent.getRegion('before-place-order') -->
                <!-- ko template: getTemplate() --><!-- /ko -->
            <!--/ko-->
        </div>
        <div class="actions-toolbar">
            <div class="primary">
                <button data-role="review-save"
                        type="submit"
                        data-bind="
                        attr: {title: $t('Place Order')},
                        enable: (getCode() == isChecked()),
                        click: placeOrder,
                        css: {disabled: !isPlaceOrderActionAllowed()}
                        "
                        class="action primary checkout"
                        disabled>
                    <span data-bind="i18n: 'Place Order'"></span>
                </button>
            </div>
        </div>
    </div>
</div>
